package org.lb.MarketingSystem.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.lb.MarketingSystem.entity.CompanyUser;
import org.springframework.stereotype.Component;

@Component(value = "companyUserMapperDao")
public interface CompanyUserMapperDao {

	public CompanyUser selectCompanyUser(@Param("accountNumber") String accountNumber,
			@Param("password") String password); // 根据账号和密码得到员工表信息

	public List<CompanyUser> select_allCompanyUser(); // 得到员工表所有员工信息

	public Integer selectDepartmentIdByUserId(Integer userId); // 根据员工的ID得到员工的部门的id

	public Integer selectPositionIdByUserId(Integer userId); // 根据员工的ID得到员工的职位的id

	public void updateCompanyUser(@Param("account") String account, @Param("password")String password,@Param("sex") String sex,
			@Param("idnum") String idnum,@Param("age") Integer age, @Param("birth") String birth,
			@Param("addre") String addre, @Param("pho") String pho,@Param("salary")Double salary,@Param("name")String name); // 修改员工表员工信息

	public List<CompanyUser> selectCompanyUserByName(String name); // 根据员工姓名查询员工表信息

	public void dropCompanyUser(Integer companyUsersId); // 根据ID删除员工表员工	

	public void deleteToPosition(Integer userId); // 删除用户与职位关联

	public void deleteToDepartment(Integer userId); // 删除用户与部门关联

	public void insertCompanyUser(CompanyUser companyUser); // 新增员工到员工表

	public void insertToDepartment(@Param("userId")Integer userId, @Param("departmentId")Integer departmentId); // 将用户与部门关联

	public void insertToPosition(@Param("userId")Integer userId,@Param("positionId")Integer positionId); // 将用户与职位关联

	public CompanyUser selectCompanyUserById(Integer userId); // 根据用户ID得到员工表信息
	
	public CompanyUser selectCompanyUserByAccount(String accountnumber); // 根据员工账号得到员工表信息
	
	public Integer selectCounts();  //查询总的条数
	
	public List<CompanyUser> selectCpmpanyuserByPage(@Param("pagenum")Integer pagenum,@Param("number")Integer number);    //根据页数获取n条数据

}
